package assignments;

public class StringTest {
	public static void main(String[] args) {
		String x = "Java";		//Assign a value to x
		String y = x;			//Now y and x refer to the same String object
		System.out.println("x string = " + x);
		System.out.println("y string = " + y);
		
		x = x + " Bean";		//Now modify the object using the x reference
		System.out.println("x string = " + x);
		System.out.println("y string = " + y);
		
		String s = "Fred";		
		String t = s;			//Now t and s refer to the same String object
		t = t.toUpperCase();
		System.out.println("s string = " + s);
		System.out.println("t string = " + t);
	}
}
